home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / MPW / Examples / PPCExamples / CExamples / PPC-68K / Readme < prev    next >
Encoding:
Text File  |  1998-12-03  |  1.2 KB  |  18 lines  |  [TEXT/MPS ]

  1. This folder contains an example of attaching an MPW 68K library to a POwerPC application.
  2. The technique involves 4 steps:
  3.   1) Creating a table of Universal Procedure Pointers, with one pointer per function in
  4.      the library. This table goes inside the PowerPC application, and is exported via the CFM.
  5.   2) Creating a "wrapper" routine which turns the MPW library into a stand-alone 68K code
  6.      resource. This routine needs to 1) ask the CFM for the location of the table (exported
  7.      from the application), and 2) place 68K pointers to the library routines into the table.
  8.      This routine is called once, when the code resource is loaded.
  9.   3) Loading and executing the code resource from the PowerPC application. This involves
  10.      using Mixed Mode to call the "wrapoper" routine which builds the table.
  11.   4) Finally, using Mixed Mode to call through the Univerasl Procedure Pointers which
  12.      were placed into the table.
  13.      
  14. To build the example, use "BuildProgram MainApp", or select "Build…" from the Build menu
  15. and specify "MainApp." This will build a 68K library (from Library.c and Library.h), a 
  16. 68K code resource (from Library, WrapperTable.h, and Wrapper.c), and an application which
  17. contains the code resource.
  18.